import java.util.Optional;

/**
 * @Projectname: java8
 * @Filename: OptionalTest
 * @Author: WangYang
 * @Data:2025/3/25
 * @Description: TODO
 */
public class OptionalTest {

    public static void main(String[] args) {
        Optional<Girl> girl = Optional.of(new Girl());
        System.out.println(girl);

        Optional<Girl> girl1 = Optional.ofNullable(new Girl());
        System.out.println(girl1);

//        Boy boy = new Boy();
//        String name = boy.getGirl().getName();
//        System.out.println(name);

        Girl girl2 = new Girl("1");
        System.out.println(girl2);



    }
}
